Skip to content

fix(hub): clear stale Runtime Broker version on empty or dev heartbeat - #9733

Closed
ptone wants to merge 2 commits into
mainfrom
scion/small-issues-6382
Closed

ptone wants to merge 2 commits into
mainfrom
scion/small-issues-6382

Conversation

@ptone

@ptone ptone commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Fixes #6382.

Summary

  • Normalize whitespace-only and unusable "dev" (case-insensitive) Runtime Broker version tokens to "" in brokerVersionToken (pkg/hub/broker_version.go), covering both writes (heartbeat, join, deprecated project registration) and reads (health summary, broker list/get display, version comparison).
  • Update handleBrokerHeartbeat (pkg/hub/handlers_runtime_brokers.go) so broker-authenticated self-heartbeats (brokerSelf) refresh b.Version even when heartbeatVersion == "", clearing any stale stored tag instead of keeping it. User-authenticated heartbeats continue to leave b.Version untouched.
  • With doctor: a Runtime Broker reporting version 'unknown' escapes the version-mismatch check #7430, clearing a stale stored version to "" turns a false broker_version_mismatch attention item into a truthful broker_version_unknown warning until the broker reports a usable version.
  • Include Version: s.version in Server.reportDurationBackstopStop (pkg/runtimebroker/duration_backstop_sweep.go) — audited all hubclient.BrokerHeartbeat senders across the repo (HeartbeatService.buildHeartbeat and reportDurationBackstopStop) so broker-self heartbeats never unintentionally clear the stored version.
  • Update docs-site/src/content/docs/reference/api.md and docs-site/src/content/docs/workstation/dashboard.md to reflect that omitted, empty, or dev broker-self heartbeat versions clear the stored version to unknown.
  • Added/updated tests in pkg/hub/broker_version_test.go, pkg/runtimebroker/duration_backstop_sweep_test.go, and pkg/store/entadapter/runtime_broker_refresh_test.go.

Verification (on rebased head c946a998 over upstream 37d46b86)

  • make fmt-check — PASS
  • make check-docs-links — PASS (0 violations)
  • go build -buildvcs=false ./pkg/hub ./pkg/runtimebroker ./cmd/scion — PASS
  • go test -buildvcs=false -timeout 20m ./pkg/runtimebroker/... — PASS
  • go test -buildvcs=false -run TestRefreshRuntimeBrokerState ./pkg/store/entadapter — PASS
  • make vet-hub-shard SHARD=4 — PASS
  • make test-hub-shard SHARD=4 NOSQLITE=1 — PASS
  • make test-hub-shard SHARD=4 — PASS
  • GOGC=40 golangci-lint run --new-from-rev=upstream-main --concurrency=1 ./pkg/runtimebroker/... ./pkg/store/entadapter/... — PASS (0 issues)
  • GOGC=40 golangci-lint run --new-from-rev=upstream-main --concurrency=1 --tests=false ./pkg/hub — PASS (0 issues)

Scion Agent (small-issues-6382-dev) added 2 commits November 28, 2026 03:09
Normalize whitespace-only and unusable "dev" broker version tokens to ""
in brokerVersionToken, and have broker self-heartbeats update stored
b.Version even when the normalized version is empty so a stale tag is
cleared instead of kept.

With #7430, clearing a stale stored version to empty turns a
false broker_version_mismatch warning into a truthful
broker_version_unknown warning. User-authenticated heartbeats continue
to leave the stored version unchanged.

For #6382.
…date docs

Include Server.version in duration backstop stop heartbeats so
broker-self heartbeats from reportDurationBackstopStop do not clear the
broker's stored version under the new empty/omitted clearing rule, and
update docs-site API reference and workstation dashboard docs to reflect
that omitted, empty, or dev heartbeat versions clear stale stored
versions.

Addresses review-1 R1 and R2 for #6382.
@ptone
ptone force-pushed the scion/small-issues-6382 branch from 9e8e25e to c946a99 Compare November 28, 2026 03:59
@ptone

ptone commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Merged upstream in GoogleCloudPlatform#5787 (merge commit f81e595d). Closing staging PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hub keeps a stale stored Runtime Broker version when the reported version is empty or dev, so doctor raises false version-mismatch warnings

1 participant